<!DOCTYPE html>
<html>
<head>
    <title>{$eju.field.seo_title}</title>
    <meta name="renderer" content="webkit" />
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=0,minimal-ui" />
    <meta name="description" content="{$eju.field.seo_description}" />
    <meta name="keywords" content="{$eju.field.seo_keywords}" />
    <link href="{eju:global name='web_cmspath' /}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    {eju:static file="skin/css/iconfont.css" /}
    {eju:static file="skin/css/amazeui.min.css" /}
    {eju:static file="skin/css/aflist.css" /}
    {eju:static file="skin/css/mobile2.css" /}

    {eju:static file="skin/js/jquery.min.js" /}
    {eju:static file="skin/js/amazeui.min.js" /}
    {eju:static file="skin/js/iscroll.js" /}
    {eju:static file="skin/js/swiper-3.4.2.jquery.min.js" /}
    {eju:static file="skin/js/amazeui.lazyload.min.js" /}
</head>
<style>
    .input-text{
        border: 1px #CCC solid;
        font-size: 1.45rem;
        float: left;
        width: 100%;
        margin-top: 1.2rem;
        margin-bottom: 1.2rem;
        border-radius: 5px;
        line-height: 3rem;
        height: 3rem;
        padding: 5px;
    }
</style>
<body>
{eju:include file="header.htm"/}

<script type="text/javascript">
    function showTime(tuanid, time_distance) {
        this.tuanid = tuanid;
        //PHP时间是秒，JS时间是微秒
        var timestamp = (new Date()).getTime();
        this.time_distance = time_distance * 1000 - timestamp;
    }
    showTime.prototype.setTimeShow = function () {
        var timer = $("#lefttime_" + this.tuanid);
        var btn_baoming = $("#btn_baoming_" + this.tuanid);
        var str_time;
        var int_day, int_hour, int_minute, int_second;
        time_distance = this.time_distance;
        this.time_distance = this.time_distance - 1000;
        if (time_distance > 0) {
            int_day = Math.floor(time_distance / 86400000);
            time_distance -= int_day * 86400000;
            int_hour = Math.floor(time_distance / 3600000);
            time_distance -= int_hour * 3600000;
            int_minute = Math.floor(time_distance / 60000);
            time_distance -= int_minute * 60000;
            int_second = Math.floor(time_distance / 1000);
            if (int_hour < 10)
                int_hour = "0" + int_hour;
            if (int_minute < 10)
                int_minute = "0" + int_minute;
            if (int_second < 10)
                int_second = "0" + int_second;
            str_time = "<i class='iconfont icon-time kft-list-overicon'>距离报名结束还有<em class='data-day'>"+int_day + "</em>天<em class='data-hour'>" + int_hour + "</em>小时<em class='data-minute'>" + int_minute + "</em>分钟<em class='data-sec'>" + int_second + "</em>秒";
            timer.html(str_time);
            var self = this;
            setTimeout(function () { self.setTimeShow(); }, 1000); //D:正确
        } else {
            btn_baoming.html("报名结束");
            btn_baoming.prop("class","span-end");
            btn_baoming.attr("data-am-modal","");
            timer.text("结束");
            return;
        }
    }
</script>
<div id="wrapper" >
    <div class="af-kft-list">
        <ul class="am-list" id="lists" data-uri="" data-total="1">
            {eju:list addfields="apply_num,end_time" pagesize="10" titlelen="20" orderby='new' id='field'}
                {eju:arcview aid="$field.joinaid" addfields='discount' id="view"}
                <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-right pet_list_one_block">
                    <!--<div class="kft-list-dis">
                        <a href="{$field.arcurl}" >
                            <p class="am-u-sm-11">{eju:notempty name='$view.is_discount'}[优惠] {$view.discount}{/eju:notempty}</p>
                            <i class="am-u-sm-1 am-header-icon iconfont icon-goto"></i>
                            <div class="clear"></div>
                        </a>
                    </div>-->
                    <div class="kft-list-wrap">
                        <div class="kft-list-pic am-u-sm-4">
                            <a href="{$field.arcurl}">
                                <img data-original="{$field.litpic}"  class="kft-list-img lazy" />
                            </a>
                        </div>
                        <div class="kft-list-info am-u-sm-5">
                            <p class="list-info-head">{$field.title}</p>
                            <p class="list-info-area">区域：{$view.province_id|get_province_name}-{$view.city_id|get_city_name}</p>
                            <p class="list-info-price">均价：<em>{$view.average_price}</em>{$view.price_units}</p>
                        </div>
                        <div class="kft-list-btn am-u-sm-3">
                            {eju:if condition="$field.end_time > time()"}
                            <span id="btn_baoming_{$e}" data-am-modal="{target:'#af-user-yy'}" data-house_id="8" data-condotour_id="9">立即报名</span>
                            {eju:else /}
                            <span id="btn_baoming_{$e}" data-am-modal="{target:'#af-user-yy'}" class="span-end" data-house_id="46" data-condotour_id="17">报名结束</span>
                            {/eju:if}
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="kft-list-data">
                        <p class="list-data-time left" id="lefttime_{$e}"></p>
                        <span class="list-data-bmnum right">已有{$field.apply_num}人报名</span>
                        <script type="text/javascript">
                            var st = new showTime("{$e}","{$field.end_time}");
                            st.setTimeShow();
                        </script>
                        <div class="clear"></div>
                    </div>
                </li>
                {/eju:arcview}
            {/eju:list}
        </ul>
        <div class="page-box">
      <ul class="pagination">
        {eju:pagelist listitem='index,pre,next,end' listsize='2' /}
      </ul>
    </div>
    </div>
</div>
<div class="am-modal am-modal-prompt" tabindex="-1" id="af-user-yy">
    <div class="am-modal-dialog" style="width: 100%;height: 40%;">
        {eju:form formid="1" success="closemodal"}
        <form method="post" id="{$field.form_name}" action="{$field.action}" onsubmit="{$field.submit}">
            <div class="am-modal-hd">预约看房 </div>
            <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="" style="top: 4px;right: 4px;position: absolute">×</a>
            <p class="am-modal-text">24小时接送机，住宿安排，专车看房，全程免费</p>
            <input type="text" class="input-text" id="{$field.attr_1}" name="{$field.attr_1}" placeholder="{$field.itemname_1}" >
            <button type="submit" id="yuyue_btn_sub" class="am-btn am-btn-warning af-yyzx">免费预约</button>
            {$field.hidden}
        </form>
        <script>
            function closemodal(){
                $(".layui-layer-loading1").hide();
                $(".am-modal,.am-dimmer").hide();
                $("body").removeClass("am-dimmer-active");
            }
        </script>
        {/eju:form}
    </div>
</div>
{eju:static file="skin/layer/layer.min.js" /}
<script>
    $(function() {
        $("img.lazy").lazyload();
    });
    $(document).ready(function(){
        $(".kft-list-btn span").click(function(){
            $("#house_id").val($(this).attr("data-house_id"));
            $("#condotour_id").val($(this).attr("data-condotour_id"));
        });
    });
</script>
{eju:static file="skin/js/laytpl.js" /}
<script>
    var page = 2,flag = true,params = {page: page};
    $(function() {
        $(window).scroll(function() {
        });
    });
</script>

</body>
</html>